$ = jQuery;



$('.lastentrymenu').html('<a href="javascript:void(0)"><q class="bgimg"></q>HQ Images</a>').click(function(d) {


    var dynamicEl = $('.thumb img[src*=styles]').toArray().map(function(d) {
        return {
            "src": d.src.replace(/styles.*public\//, ''),
            "thumb": d.src
        }
    })

    $(document).lightGallery({
        dynamic: true,
        caption: true,
        desc: true,
        mobileSrc: true,
        dynamicEl: dynamicEl
    });

})